home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 49
/
Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso
/
-serious-
/
misc
/
football
/
exec
/
viewcupresults.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-11-29
|
5KB
|
205 lines
/* ***********************************************************************
CUP RESULTS PROGRAM FOR FOOTBALL REXX SUITE
---------------------------------------------
Copyright Mark Naughton 1997
Version Date History
--------------------------------------------------------------------------
1.0 011197 First release.
151297 Added routine to improve on the round names. Tidied
display. Improved method that read the file and
formatted it - smaller.
260898 Amended bettername() for 1 or 2 legs.
250899 Added error msg to file check.
1.1 030999 Converted to use locale. Some error messages, before
reading the locale, will still be in English.
English language still needs to appear in the datafiles
for processing by Football.
**************************************************************************
Procedure
---------
1. Check files exist.
2. Open file and print all lines without '*' with the exception of
the league name which is underlined; possibly dates as well.
3. Also reformat "*Round" from the file into a more readable look.
3. Close file and exit.
************************************************************************** */
parse arg league_file
version = 1
league_file = "Data/" || league_file
input_file = '.scf'
separator = '*'
separator2 = '#'
if open(datafile,"Data/Football.locale",'r') then do
line = readln(datafile)
locdir = strip(line)
close(datafile)
end
else do
say
say "ERROR : (ViewCupResults)"
say
say "Cannot read 'Data/Football.locale' for the locale settings."
exit
end
dcupdir = locdir"Football.locale_cup"
locdir = locdir"Exec/ViewCupResults.data"
if open(datafile,"ENV:FootballRXPath",'r') then do
line = readln(datafile)
rxdir = strip(line)
close(datafile)
end
else
rxdir = "SYS:Rexxc/"
if exists(locdir) > 0 then do
address command rxdir'rx 'locdir
VarCount = getclip('VarCount')
do i = 1 to VarCount
interpret getclip('var.'i)
end
end
else do
say
say "ERROR : (ViewCupResults)"
say
say "Cannot find '"locdir"' to read locale settings."
exit
end
if exists(dcupdir) > 0 then do
address command rxdir'rx 'dcupdir
VarCount = getclip('VarCount')
do i = 1 to VarCount
interpret getclip('var.'i)
end
end
else do
say
say "ERROR : (ViewCupResults)"
say
say "Cannot find '"dcupdir"' to read cup locale settings."
exit
end
if exists(league_file || input_file) = 0 then do
say
say vcr_error
say
say vcr_t2"'"league_file||input_file"'."
exit
end
if open(datafile,league_file || input_file,'r') then do
say
say center(vcr_t5,78)
say
say center(vcr_t6,78)
say
do while ~eof(datafile)
line = readln(datafile)
if pos(separator,line) = 0 then do
if pos(separator2,line) > 0 then do
if pos("#Score After Extra Time",line) > 0 then
line = overlay("--"left(cup_saet,25," "),line,1,25)
if pos("#Penalties",line) > 0 then
line = overlay("--"left(strip(fc_t8),25," "),line,1,25)
if pos("#1st Leg",line) > 0 then
line = overlay("--"left(cum_t32,25," "),line,1,25)
end
say line
end
else do
if pos("**",line) > 0 then do
parse var line "** "cupname
say center(cupname,78)
say "-------------------------------------------------------------------------------"
end
else do
if pos("*Round=",line) > 0 then do
if pos(" Leg",line) > 0 then do
k = pos(" Leg",line)
roundname = bettername(substr(line,8,5),substr(line,k-1,6))
end
else
roundname = bettername(substr(line,8,5),cs_t29)
say
say trim(roundname)
uline = ''
do i=1 to length(trim(roundname))
uline = insert('-',uline,i,1)
end
say strip(uline)
end
end
end
end
say "-------------------------------------------------------------------------------"
close(datafile)
end
else do
say
say vcr_error
say
say vcr_t3"'"league_file||input_file"'"vcr_t4
end
exit
/* Routine ----------------------------------------------------------- */
bettername:
parse arg crn,legless
trdn = substr(crn,1,1)
if datatype(trdn,'n') = 1 then do
if pos("Replay",crn) > 0 then
trn = strip(word(crn,1))" "cs_t28" "cs_t31
else do
parse var crn roundno" " .
trn = strip(crn)" "cs_t28
end
end
else do
if pos("Final",crn) > 0 then do
if pos("Replay",crn) > 0 then
trn = cs_t30" "cs_t31
else
trn = cs_t30
end
if pos("Semi",crn) > 0 then do
if pos("Replay",crn) > 0 then
trn = cs_t32" "cs_t31
else
trn = cs_t33
end
if pos("Quart",crn) > 0 then do
if pos("Replay",crn) > 0 then
trn = cs_t34" "cs_t31
else
trn = cs_t35
end
if pos("Third",crn) > 0 then do
trn = cs_t36
end
end
if pos("1 Leg",legless) > 0 then
trn = trn" ("cum_t32")"
if pos("2 Legs",legless) > 0 then
trn = trn" ("cum_t33")"
return trn
/* ------------------------------------------------------------------- */